def insert(a):
    for i in range(0, len(a)):
        for index in range(i, 0, -1):
            if a[index] < a[index - 1]:
                a[index], a[index - 1] = a[index -1], a[index]
            else:
                break
    return a


# # 用法
# a = [5, 26, 8, 94, 2, 84]
# insert(a)
# print(a)  # [2, 5, 8, 26, 84, 94]